# -*- coding: utf-8 -*-
#----------------------------------------------
# @note: example link for test chain
# @author: Andrey Simine
# @copyright: (R) 2016 Andrey Simine
#----------------------------------------------
import time, sys

from pprint import pprint
from chainlib.basic_link import BasicLink

__author__ = 'asimine'

class UserLink(BasicLink):

    def __init__(self, context):
        super(UserLink, self).__init__(context)

    def execute(self):
        print("Compile some source code in test mode ...")
        print("You did it!")
        print("Update context ...") 
        newvalue = {"dynamic1": "testvalue",
                    "dynamic2": [123, "2323"],
                    "dynamic3": {"test1": 123,
                                 "test2": "qwerty"}
                    }
        self.update_context(newvalue)
        
        print("------------------------------------------") 
        pprint(self.context)
        print("------------------------------------------") 
        
        print("Done.")

